# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   File Name：     ConfigRelevance.py
   Description :   
   Author :        ZhangYiLin
   date：          2020/12/07 15:17
-------------------------------------------------
   Change Activity:
                   2020/12/07 15:17
-------------------------------------------------
"""
import configparser

from common.FunctionReplace import function_replace
from common.NewLoguru import global_log


class ConfRelevance:
    # 关联文件读取配置
    def __init__(self, _path):
        global_log.info("初始化关联文件")
        self.config = configparser.ConfigParser()
        self.config.read(_path, encoding="utf-8")
        self.host = None

    def get_relevance_conf(self):
        self.host = self.config["relevance"]
        relevance = dict()
        global_log.debug("读取初始关联文件内容：   %s" % self.host.items())
        for key, value in self.host.items():
            relevance[key] = function_replace(value)
        global_log.debug("初始关联内容数据处理后：   %s" % relevance)
        return relevance

    # def get_case_conf(self):
    #     case = dict()
    #     logging.debug("读取测试用例文件内容：   %s" % self.config.items())
    #     for key, value in self.config.items():
    #         if isinstance()
    #         case[key] = function_replace(value)
